All Functions of Week 7

rm

{base}

Remove objects

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

mean

{base}

Get mean of a vector

setwd

{base}

Set Working Directory

plot

{graphics}

Generic function from base R to produce a plot

min

{base}

Get minimum of a vector

seq

{base}

Create a sequence

which.min

{base}

Return the index of the smallest value in a vector

ordered

{dplyr}

Create an ordered factor

summary

{base}

Obtain summary statistics or detailed regression output

boxplot

{graphics}

Plot a simple box plot

arrange

{dplyr}

Sort values of data frame according to a variable/combination of variables

geom_histogram

{GGPLOT2}

Generates a histogram

range

{base}

Return range of values

quantile

{stats}

Obtain empirical quantiles of a vector

labs

{GGPLOT2}

Customise labels in GGPLOT2

c

{base}

Combine values/vectors into a vector

median

{stats}

Get median of a vector

hist

{graphics}

Plot a simple histogram

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

with

{base}

evaluate expression in the context of a data frame

sd

{stats}

Get standard deviation of a vector

read_excel

{readxl}

Read an Excel file

var

{stats}

Calculate variance

desc

{dplyr}

Arrange in descending order

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

install.packages

{utils}

Install R packages

ggplot

{GGPLOT2}

Create a ggplot graph

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

length

{base}

Returns number of elements in an object

print

{base}

Print object to the console

nrow

{base}

Get number of rows of a data frame

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

library

{base}

Load an R package

mutate

{dplyr}

Create new variables

max

{base}

Get maximum of a vector

which.max

{base}

return index of the largest value in a vector

cut

{base}

Convert Numeric to Factor

sum

{base}

Get sum of numeric values or a vector

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

The end!